﻿using System.Configuration;

namespace K3R.PostcodeAnywhere {
	public class PostcodeAnywhereConfig : ConfigurationSection {
		[ConfigurationProperty("accountCode", IsRequired = true)]
		public string AccountCode {
			get {
				return (string)base["accountCode"];
			}
			set {
				base["accountCode"] = value;
			}
		}

		[ConfigurationProperty("licenceKey", IsRequired = true)]
		public string LicenceKey {
			get {
				return (string)base["licenceKey"];
			}
			set {
				base["licenceKey"] = value;
			}
		}
	}

	public static class Settings {
		private static PostcodeAnywhereConfig _settings = (PostcodeAnywhereConfig)ConfigurationManager.GetSection("k3r.postcodeAnywhere");
		public static string AccountCode {
			get {
				return _settings.AccountCode;
			}
		}

		public static string LicenceKey {
			get {
				return _settings.LicenceKey;
			}
		}
	}
}
